﻿CREATE TABLE [dbo].[DBExecutions] (
    [ID]               UNIQUEIDENTIFIER DEFAULT (newid()) NOT NULL,
    [ExecutedQuantity] INT              NOT NULL,
    [ExecutedPrice]    FLOAT            NOT NULL,
    [ExecutionTime]    DATETIME         NOT NULL,
    [CounterParty]     VARCHAR (255)    NULL,
    [OrderID]          UNIQUEIDENTIFIER NULL,
    PRIMARY KEY CLUSTERED ([ID] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF),
    CHECK ([ExecutedQuantity]>(0)),
    CHECK ([ExecutedPrice]>(0)),
    FOREIGN KEY ([OrderID]) REFERENCES [dbo].[DBOrder] ([ID]) ON DELETE CASCADE ON UPDATE NO ACTION
);

